<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

	<div id="editForProjectMilestoneFinishApplyQualityCheck" class="easyui-window" title="项目节点质量审核" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:720px; height:430px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center'" style="padding:10px;">
				<form id="editForprojectMilestoneFinishApplyQualityCheckForm" method="post" action="qualityCheckProjectMilestoneFinishApply" style = "width:100%; height: 100%">
					<input type="hidden" id="projectMilestoneFinishApplyQualityCheckId" name = "id"/>
					<input type="hidden" id="projectMilestoneFinishApplyQualityCheckStatus" name = "status" value="1000"/>
					<input type="hidden" id="projectMilestoneFinishApplyQualityCheckQualityCheckStatus" name = "qualityCheckStatus" value="Y"/>
					<input type="hidden" id="projectMilestoneFinishApplyQualityCheckQualityCheckPersonId" name = "qualityCheckPerson.id" value="${currentUser.id }"/>
					<input type="hidden" id="projectMilestoneFinishApplyQualityCheckProjectMilestoneId" name = "projectMilestone.id"/>
					<input type="hidden" id="projectMilestoneFinishApplyQualityCheckProjectMilestoneStatus" name = "projectMilestone.status" value="1000"/>
					<table>
						<tr>
							<td width="100px;" align="right">项目名称：</td>
							<td width="160px">
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneFinishApplyQualityCheckProjectName" style="width: 200px;" />
							</td>
							<td width="100px;" align="right">节点名称：</td>
							<td>
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneFinishApplyQualityCheckProjectMilestoneName" style="width: 200px;" />							
							</td>
						</tr>
						<tr>
							<td align="right">申请人：</td>
							<td>
							<input class="easyui-textbox" readonly="readonly" id="projectMilestoneFinishApplyQualityCheckApplyPersonName" style="width: 200px;" />							
							</td>
							<td align="right">申请时间：</td>
							<td>
								<input class="easyui-datetimebox" readonly="readonly" id="projectMilestoneFinishApplyQualityCheckApplyTime" style="width: 200px;"/>
							</td>
						</tr>
						<tr>
							<td align="right">申请说明：</td>
							<td colspan="3">
								<input class="easyui-textbox"  readonly="readonly" data-options="multiline:true" style="width: 510px; height: 120px;" id="projectMilestoneFinishApplyQualityCheckApplyDescription">
							</td>
						</tr>
						<tr>
							<td width="100px" align="right">质量检测日期：</td>
							<td>
								<input class="easyui-datebox" data-options="required:true" name="qualityCheckDate" id="lookQualityCheckProjectMilestoneQualityCheckDate" style="width: 200px;" />
							</td>
						</tr>
						<tr>
							<td align="right">质量检测说明：</td>
							<td colspan="3">
								<input class="easyui-textbox" data-options="multiline:true" style="width: 510px; height: 120px;" name="qualityCheckDescription" id="lookQualityCheckProjectMilestoneQualityCheckDescription">
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editForprojectMilestoneFinishApplyQualityCheckForm').submit()" style="width:80px">通过</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#projectMilestoneFinishApplyQualityCheckStatus').val('0999');$('#projectMilestoneFinishApplyQualityCheckProjectMilestoneStatus').val('0055');$('#editForprojectMilestoneFinishApplyQualityCheckForm').submit();" style="width:80px">驳回</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editForProjectMilestoneFinishApplyQualityCheck').window('close')" style="width:80px">关 闭</a>
			</div>
		</div>
	</div>

	
	<script type="text/javascript">
	function editForprojectMilestoneFinishApplyQualityCheck(id){
		$.ajax({ url: "getProjectMilestoneFinishApply?id="+id, success: function(data){
			clearForm("editForprojectMilestoneFinishApplyQualityCheckForm", "editForProjectMilestoneFinishApplyQualityCheck");
			
			var val = $.parseJSON(data);
			$("#projectMilestoneFinishApplyQualityCheckId").val(id);
			$("#projectMilestoneFinishApplyQualityCheckStatus").val("1000");
			$("#projectMilestoneFinishApplyQualityCheckQualityCheckStatus").val("Y");
			$("#projectMilestoneFinishApplyQualityCheckQualityCheckPersonId").val("${currentUser.id}");
			$("#projectMilestoneFinishApplyQualityCheckProjectMilestoneId").val(val.projectMilestoneId);
			$("#projectMilestoneFinishApplyQualityCheckProjectMilestoneStatus").val("1000");
			
			$("#projectMilestoneFinishApplyQualityCheckProjectName").textbox("setValue",val.projectName);
			$("#projectMilestoneFinishApplyQualityCheckApplyPersonName").textbox("setValue",val.applyPersonName);
			$("#projectMilestoneFinishApplyQualityCheckApplyTime").textbox("setValue",val.applyTime);
			$("#projectMilestoneFinishApplyQualityCheckApplyDescription").textbox("setValue",val.applyDescription);
			$("#projectMilestoneFinishApplyQualityCheckProjectMilestoneName").textbox("setValue",val.projectMilestoneName);
		}});
	}
	
	$("#editForprojectMilestoneFinishApplyQualityCheckForm").form({
		onSubmit: function(){
			var isValid = $(this).form('validate');
			return isValid;	// 返回false将停止form提交 
	    },
		success:function(data){
			var val = $.parseJSON(data);
			if(val.success){
				$('#dg').datagrid('reload');
				bottomRight('提示', '操作成功！');
				$('#editForProjectMilestoneFinishApplyQualityCheck').window('close');
			}else{
				$.messager.alert("提示", val.msg, "error");
			}
		}
	});
	</script>